import React from "react";
import {
  HashRouter as Router,
  Switch,
  Route,
} from "react-router-dom";
// 引入封装好的懒加载方法
import { lazy } from "../util/index"

// import Login from "../views/users/login"
import Info from "../views/info"

const Reg = lazy("views/users/reg")
const Login = lazy("views/users/login")
// eslint-disable-next-line
export default () => {
  return (
    <Router>
      <div>
        <Switch>
          <Route exact path="/">
            <Login />
          </Route>
          <Route exact path="/login/:username">
            <Login />
          </Route>
          <Route path="/info">
            <Info />
          </Route>
          <Route exact path="/reg">
            <Reg />
          </Route>
        </Switch>
      </div>
    </Router>
  );
}